package com.sym.spring.web;

import com.sym.spring.annotation.Autowired;
import com.sym.spring.annotation.ResController;
import com.sym.spring.annotation.ResquestMapping;
import com.sym.spring.bean.dto.ResultDTO;
import com.sym.spring.bean.pojo.Student;
import com.sym.spring.service.StudentService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 作    者： yingming shen
 * 修改时间： 2020/6/2 0:08.
 * 描   述：
 */
@ResController
@ResquestMapping("/student")
public class DemoController {

    @Autowired
    private StudentService studentService;

    @ResquestMapping("/getStudent")
    public void   query(HttpServletRequest request, HttpServletResponse resp){
        Student student = studentService.getStudent();
        System.out.println(student);
        try {
            resp.getWriter().write(student.toString());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
